/*
 * @Author: Joel
 * @Date: 2025-04-17 14:19:25
 * @LastEditors: Joel
 * @LastEditTime: 2025-04-22 08:50:07
 * @FilePath: /gd32f303cct6/usr/board_driver/ems_ctrl.h
 * @Description: 
 * Copyright (C) 2025 YiJiaLink, All Rights Reserved. 
 * 2025-04-17 14:19:25
 */
#ifndef __EMS_CTRL_H
#define __EMS_CTRL_H
 
 /* 包含头文件代码 */
 
 #include <stdio.h>
 #include <stdint.h>
 #include <string.h>

#include "gd32f30x.h"

 #if defined(__cplusplus)
 extern "C" {
 #endif /*_cplusplus*/


 /*EMS 硬件连接 */
 #define EMS_GPIO_CLK                    RCU_GPIOB
 #define EMS_GPIO_PORT                   GPIOB

 #define EMS_PWM1_PIN                         GPIO_PIN_8
 #define EMS_PWM2_PIN                         GPIO_PIN_7
 #define EMS_PWM_BOOT_PIN                     GPIO_PIN_6

 enum EMS_PWM
{
    EMS_PWM1,
    EMS_PWM2,
    EMS_PWM_BOOT
};
/* 功能打包 */
struct ems_func
{
    /* data */
    void (*init_ems)(void);
    void (*run_ems)( enum EMS_PWM EMS_CHANNEL,uint32_t duty);
    void (*stop_pump)(enum EMS_PWM EMS_CHANNEL,uint8_t flag);
};
struct ems_func *ems_driver_init(void);


#if defined(__cplusplus)
}
#endif /*_cplusplus*/

#endif
/* el psy congroo */



